package com.wanxi.controller;

import com.wanxi.model.Message;
import com.wanxi.model.Sign;
import com.wanxi.service.DataService;
import com.wanxi.service.SignService;
import com.wanxi.service.UserService;
import com.wanxi.service.impl.DataServiceImpl;
import com.wanxi.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/sign")
public class SignController {
    @Autowired
    SignService signService;

    @GetMapping("/getSignRecord")
    public Message<Sign> getSignRecord(@RequestParam Map map){
        return signService.getSignRecord(map);
    }
    @PostMapping("/addSignRecords")
    public int addSignRecords(@RequestParam Map map){
        return signService.addSignRecords(map);
    }
    @PostMapping("/deleteSigns")
    public int deleteSigns(@RequestParam Map map){
        return signService.deleteSigns(map);
    }
    @GetMapping("/getSignByUserAndSignTime")
    public boolean getSignByUserAndSignTime(String username){
        return signService.getSignByUserAndSignTime(username);
    }
}
